Skip to content

feat: 拆分 default workdir 与 session workdir(P0-3)#131

Merged
minorcell merged 9 commits into
1024XEngineer:mainfrom
Cai-Tang-www:P0-3
Apr 3, 2026
Merged

feat: 拆分 default workdir 与 session workdir(P0-3)#131
minorcell merged 9 commits into
1024XEngineer:mainfrom
Cai-Tang-www:P0-3

Conversation

@Cai-Tang-www

@Cai-Tang-www Cai-Tang-www commented Apr 3, 2026

Copy link
Copy Markdown
Collaborator

背景

为落实 #121,需要把全局 workdir 语义拆分为“配置默认值”和“会话运行态”,避免用户在会话中切换目录时污染全局 YAML。

本次改动

  • 配置层
    • 引入 default_workdir 持久化语义
    • 兼容读取 legacy workdir
  • Runtime
    • Session 增加会话级 workdir
    • 工具执行与上下文构建统一走「session 优先」的 workdir 解析
  • TUI
    • 新增 /workspace/cwd 别名)命令,支持会话级工作区切换
    • & 命令执行改为使用当前会话工作区,避免“显示目录”和“执行目录”不一致
  • 测试
    • 补齐 config / runtime / tui 的回归与兼容测试

解析优先级

  1. tool call 显式子目录参数(如 bash.workdir
  2. session workdir
  3. config default_workdir

验证

  • go test ./...

风险与兼容

-兼容个🥚 一刀切

Closes #121

@codecov

codecov Bot commented Apr 3, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.54106% with 32 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
internal/runtime/runtime.go 81.81% 8 Missing and 8 partials ⚠️
internal/tui/update.go 82.79% 10 Missing and 6 partials ⚠️

📢 Thoughts on this report? Let us know!

Comment thread internal/config/loader.go Outdated
Comment thread internal/tui/commands.go Outdated
@minorcell minorcell merged commit fc78692 into 1024XEngineer:main Apr 3, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(config/runtime): P0-3 拆分 default workdir 与 session workdir

2 participants